from rest_framework.routers import SimpleRouter
from edoego.views import *
from django.urls import path

router = SimpleRouter()
router.register("api/input_log",InputLogViewSet)
router.register("api/device_list",DeviceViewSet)
router.register("api/bag_list",BagViewSet)
router.register("api/wechat_user_score_list",WeChatUserScoreViewSet)
router.register("api/clean_list",CleanLogViewSet)
router.register("api/wechat_user_list",WechatUserViewSet)
router.register("api/today_clean_task",TodayCleanTaskViewSet)
router.register("api/sort_list",SortLogViewSet)
router.register("api/app_update",AppVersonViewSet)
router.register("api/image",ImageViewSet)
router.register("api/scan",ScanLogViewSet)
router.register("api/input/list",InputListViewSet)
router.register("api/data/input",TotalDataViewSet)


urlpatterns = [
#     path("api/device_list/<int:device_user>",DeviceViewSet.as_view({'get':'list'}),name='device-list-by-user'),
    path("api/device_list/<int:device_id>",DeviceViewSet.as_view({'post':'update'}),name='device-update'),
    path("api/mqtt_login",WeChatLoginView.as_view(),name="mqtt-login"),
    path("api/app_update/version",AppUpdateViewSet.as_view(),name="app-update"),
    path("api/qiniu/token",QiniuTokenViewSet.as_view(),name="qiniu"),
    path("api/mqtt_open_box",CleanerOpenBoxView.as_view(),name="mqtt-open_box"),
    path("api/scan/<str:device_id>",ScanLogViewSet.as_view({'get':'list'}),name='scan-update'),
    path("api/clean_list/<str:bag_code>",CleanLogViewSet.as_view({'get':'list'}),name="bag-get-clean"),
    path("api/wx_qrcode_access",WxAccessTokenViewSet.as_view(),name='wx-access'),
    path("api/wx_openid",WxOpenId.as_view(),name='openid'),
    path("api/wx_qrcode",WxQrcode.as_view(),name='qrcode'),
    path("api/user_pre_score",UserPreScore.as_view(),name='pre-score'),
    path("api/wx_pay",WxPayViewSet.as_view(),name='pay'),
    path("api/get_score",UserPreToScore.as_view(),name="get-score"),
    path("api/manager/sharing_score",SharingUnCheck.as_view(),name="sharing-score"),
    path("api/manager/sharing_score_today",SharingUnCheckToday.as_view(),name="sharing-score-today"),
    path("api/manager/sharing_score_list",SharingUnCheckTodayData.as_view(),name="sharing-score-list"),
    path("api/manager/sharing_checked",SharingChecked.as_view(),name="sharing-checked"),
    path("api/manager/sharing_wxpay",SharingWxPayViewSet.as_view(),name="sharing-wxpay")
]
urlpatterns += router.urls

